
import java.io.IOException;
public class TestBridge {

    public static void main(String[] args) throws IOException {
        IMessage iMessage = new EmailMessage();
        AbstractBridgeMessage abstractBridgeMessage = new UrgentMessage(iMessage);
        abstractBridgeMessage.sendMessage("你好", "友人A");
        System.out.println("------------分割线----------------");

        iMessage = new SmsMessage();
        abstractBridgeMessage = new CommonMsg(iMessage);
        abstractBridgeMessage.sendMessage("你好", "友人B");
        System.out.println("------------分割线----------------");

        iMessage = new WebMessage();
        abstractBridgeMessage = new UrgentMessage(iMessage);
        abstractBridgeMessage.sendMessage("你好", "友人C");
        System.out.println("------------分割线----------------");


    }
}